package com.aotain.nyx.flink;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.java.tuple.Tuple2;

public class DipSoucreStreamStat implements MapFunction<Tuple2<String,String>, Tuple2<String,String>> {

	/** 
	* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么) 
	*/ 
	private static final long serialVersionUID = -8945122766041971355L;
	String dbJson ;
	
	
//	public DipSoucreStreamStat(String dbJson){
//		this.dbJson = dbJson;
//	}

	@Override
	public Tuple2<String, String> map(Tuple2<String,String> value) throws Exception {
		// TODO Auto-generated method stub

		Tuple2<String,String> ret = new Tuple2<String,String>();
		if(value.f1 != null) {
			String[] splits = value.f1.split("\\|",-1);
			String dip = splits[0];
			ret.setFields(dip, value.f1);
		}
		return ret;
	}

}
